package principal;

import java.awt.Point;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;

import javax.swing.JFrame;

public class Fenetre extends JFrame implements WindowListener
{
	
	private PanelPrincipal p;
	private static int largeur = 800;
	private static int hauteur = 600;
	
	public Fenetre()
	{
		super("BlackJoe");
		
		p= new PanelPrincipal();
		add(p);
		
		this.setVisible(true);
		this.setSize(800,600);
		this.setResizable(false);
		this.setLocation(new Point(getLargeur(),getHauteur()));
		this.addWindowListener(this);
	}
	@Override
	public void windowActivated(WindowEvent arg0) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void windowClosed(WindowEvent arg0) 
	{
		System.exit(0);	
	}
	@Override
	public void windowClosing(WindowEvent arg0) {
		System.exit(0);
		
	}
	@Override
	public void windowDeactivated(WindowEvent arg0) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void windowDeiconified(WindowEvent arg0) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void windowIconified(WindowEvent arg0) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void windowOpened(WindowEvent arg0) {
		// TODO Auto-generated method stub
		
	}
	public static void setHauteur(int hauteur) {
		Fenetre.hauteur = hauteur;
	}
	public static int getHauteur() {
		return hauteur;
	}
	public static void setLargeur(int largeur) {
		Fenetre.largeur = largeur;
	}
	public static int getLargeur() {
		return largeur;
	}
}
